<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.anhry.app.safety.util.Util"%>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title> 重大隐患管理 &gt; 管理部门上报列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/right.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/dbdialog/lhgdialog.js"></script>
	<script type="text/javascript" src="<%=path%>/js/selected.js"></script>
	<script type="text/javascript" src="<%=path%>/js/util.js"></script>
	<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js" defer="defer"></script><base target="_self" />
	<script type="text/javascript">
		$(function(){
			initSelArray('cUnit:1','cDept:1','cMinType:2');
			var cCounty = '${cCounty}';
			var cUnit = '${cUnit}';
			var cDept = '${cDept}';
			if(null!=cCounty && cCounty!=""){
				changeCounty(cCounty);
			}
	   		if(cUnit!=null && cUnit!=""){
	   			changeUnit(cUnit);
	   			selected('cUnit',cUnit);	//加载选中项
	   		}
	   		if(cDept!=null && cDept!=""){
	   			selected('cDept',cDept);	//加载选中项
	   		}
	   		
	   		var cMaxType = '${cMaxType}';
			var cMinType = '${cMinType}';
			if(null!=cMaxType && cMaxType!=""){
				changeType(cMaxType);
			}
			if(cMinType!=null && cMinType!=""){
	   			selected('cMinType',cMinType);	//加载选中项
	   		}
	   		
		});
		
		function changeCounty(cid){
	   		var urls='<%=basePath%>/util/data_getDept.action?cUnit='+cid+"&cCounty=1";
	   		buildSelect(cid, 'cUnit',urls,'1');
	   	}
	   	function changeUnit(uid){
	   		var urls="<%=basePath%>/util/data_getDept.action?cUnit="+uid;
	   		buildSelect(uid, 'cDept',urls,'1');
	   	}
	   	function changeType(maxid){
	   		var urls="<%=basePath%>/util/data_getCorpType.action?cMaxType="+maxid;
	   		buildSelect(maxid, 'cMinType',urls,'2');
	   	}
	   	function reSearch(){
	   		window.location.href='<<%=basePath%>/zczb/big_yhList.action?search=1';
	   	}
		function opdlg(id){
   			infoDialog('yhInfo','隐患详细信息','800','400','<%=path%>/zczb/big_yhShow.action?yhId='+id+'');
		}
		function doAudit(id){
			infoDialog('yhAudit','重大隐患审核','750','300','<%=path%>/zczb/big_corpYhAudit.action?yhId='+id+'&auditType=5');
		}
		function doGp(id){
			infoDialog('yhGp','挂牌督办信息','650','300','<%=path%>/zczb/big_corpYhAudit.action?yhId='+id+'&auditType=2');
		}
		function doZg(id){
			infoDialog('yhZg','隐患整改信息','750','400','<%=path%>/zczb/big_corpYhAudit.action?yhId='+id+'&auditType=3');
		}
		function doXh(id){
			infoDialog('yhXh','重大隐患摘牌销号','450','200','<%=path%>/zczb/big_corpYhAudit.action?yhId='+id+'&auditType=4');
		}
		function doBack(id){
			infoDialog('yhback','打回理由','450','200','<%=path%>/zczb/big_corpYhAudit.action?yhId='+id+'&auditType=6');
		}
		function doSqXh(id){
			document.form1.yhId.value=id;
			document.form1.action='<%=path%>/zczb/big_yhSqXh.action';
			document.form1.submit();
		}
		function doShow(id){
			infoDialog('yhZgShow','重大隐患整改信息','750','400','<%=path%>/zczb/big_yhZgShow.action?yhId='+id);
		}
	</script>
  </head>
  
  <body>
	<div  class="body-box">
		<div class="map">
			<div class="map_con">
				您当前的位置：自查自报 &gt; 重大隐患管理 &gt; 管理部门上报列表
			</div>
		</div>
		<div id="container">
			<fieldset class="serarch_set">
				<legend>
			  		<div class="search">查询条件</div>
			  	</legend>
			  	<form action="<%=basePath%>/zczb/big_yhList.action?search=1" method="post" name="zcForm">
			   		<label style="width: 90px;">属地：</label> 
			   			<s:select list="sdList" name="cCounty" listKey="id" listValue="deptName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cCounty" onchange="changeCounty(this.value);"></s:select>
			   			<s:select list="#{}" name="cUnit" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cUnit" onchange="changeUnit(this.value);"></s:select>
			   			<s:select list="#{}" name="cDept" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cDept"></s:select>
			   		<br/>
			   		<label style="width: 90px;">企业类型：</label> 
			   			<s:select list="typeList" name="cMaxType" listKey="id" listValue="typeName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cMaxType" onchange="changeType(this.value);"></s:select> 
			   			<s:select list="#{}" name="cMinType" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cMinType"></s:select>
			   		<br/>
			   		<label style="width: 90px;">企业级别：</label>
			   			<s:select list="#{'A':'A','B':'B','C':'C','D':'D','E':'未评级' }" name="cGrade" value="%{cGrade}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
		   			<label style="width: 90px;margin-left:10px;">行业部门：</label><s:select list="hyList" name="cHy" value="%{cHy}" listKey="id" listValue="deptName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<br/>
		   			<label style="width: 90px;">挂牌督办级别：</label>
		   				<s:select list="#{1:'国家级挂牌督办',2:'省级挂牌督办',3:'地市级挂牌督办',4:'县（市）、区（管委会）级挂牌督办',5:'县(市、区)、开发区行业级挂牌督办'}" name="cGp" listKey="key" listValue="value" value="%{cGp}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<label style="width: 90px;margin-left:10px;">是否整改：</label>
			   			<s:select list="#{0:'否',1:'是'}" name="cZg" listKey="key" listValue="value" value="%{cZg}" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;"></s:select>
			   		<br/>
			   		<label style="width: 90px;">发现时间：</label>
			   			<input name="cBtime" id="time1" class="Wdate" type="text" value="${cBtime }" readonly="readonly" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')}'})"/>--<input name="cEtime" id="time2" class="Wdate" readonly="readonly" type="text" value="${cEtime }" onClick="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}'})"/>
			   		<br/>
			   		<label style="width: 90px;">企业名称：</label><input type="text" name="keyWord" value="${keyWord }" size="50%">
			   		<input type="submit" value="搜 索" class="link_input" name="btnsx">
			   		<input type="button" value="重置搜索条件" class="link_input" name="btnsx" onclick="reSearch();">
			   		<input type="hidden" name="num" value="${page.num }">
			   		<input type="hidden" name="size" value="${page.size }">
			  	</form>
			</fieldset>
			<s:set name="userGrade" value="#session.adminuser.tbUserGrade.id"></s:set>
		  	<table border="0" cellpadding="0" cellspacing="0" class="mytable">
		   		<thead>
			    	<tr class="fixedHeaderTr">
			     		<th width="5%">序号</th>
			     		<th width="8%">发现时间</th>
			     		<th width="20%">企业名称</th>
			     		<th width="5%">企业级别</th>
			     		<th width="10%">主管行业</th>
			     		<th width="15%">隐患类型</th>
			     		<th width="10%">挂牌督办级别</th>
			     		<th width="5%">是否整改</th>
			     		<th width="9%">状态</th>
			     		<th width="13%">操作</th>
			    	</tr>
		   		</thead>
			   	<tbody>
			   		<s:if test="%{objList.size>0}">
			   			<s:iterator value="objList" id="obj" status="x">
				   			<tr>
					     		<td align="center">${x.index+1+(page.num-1)*page.size}</td>
					     		<td align="center"><s:date name="#obj.yhFxTime" format="yyyy-MM-dd"/> </td>
					     		<td align="left"><a href="<%=basePath%>/enterprise/corp_look.action?corpId=${obj.corpId }" target="_blank" title="${obj.corpName}">${obj.corpName }</a></td>
					     		<td align="center">${obj.corpGrade }</td>
					     		<td align="center">${obj.deptMainName }</td>
					     		<td align="center">${obj.yhType1Name}&nbsp;&nbsp;${obj.yhType2Name }</td>
					     		<td align="center">
					     			<s:if test="%{#obj.yhGpType==1}">国家级挂牌督办</s:if>
					     			<s:elseif test="%{#obj.yhGpType==2}">省级挂牌督办</s:elseif>
					     			<s:elseif test="%{#obj.yhGpType==3}">地市级挂牌督办</s:elseif>
					     			<s:elseif test="%{#obj.yhGpType==4}">县（市）、区（管委会）级挂牌督办</s:elseif>
					     			<s:elseif test="%{#obj.yhGpType==5}">县(市、区)、开发区行业级挂牌督办</s:elseif>
					     			<s:else><font color="red">未挂牌督办</font></s:else>
					     		</td>
					     		<td align="center">${obj.yhIsZg==0?'<font color="red">否</font>':'是' }</td>
					     		<td align="center">
					     			<s:if test="%{#obj.yhStatus==1}">${obj.yhCome==3?'市行业审核':'县(市、区)、开发区安办审核' } </s:if>
					     			<s:elseif test="%{#obj.yhStatus==2}">市安委会审核</s:elseif>
					     			<s:elseif test="%{#obj.yhStatus==95}"><font color="red">打回</font></s:elseif>
					     			<s:elseif test="%{#obj.yhStatus==96}">已确认</s:elseif>
					     			<s:elseif test="%{#obj.yhStatus==97}">已挂牌</s:elseif>
					     			<s:elseif test="%{#obj.yhStatus==98}">申请销号</s:elseif>
					     			<s:elseif test="%{#obj.yhStatus==99}">已销号</s:elseif>
					     		</td>
					     		<td align="center">
						     		<a href="javascript:void(0);" onclick="opdlg('${obj.id }');" title="查看隐患详细信息">查看</a>
						     		<s:if test="%{#userGrade==4 || #userGrade==6}"><!-- 县(市、区)、开发区行业上报的 -->
						     			<s:if test="%{#obj.yhAudit==2 || #obj.yhAudit==3 || #obj.yhAudit==96}"><!-- 县(市、区)、开发区安委会确认或者市安委会确认 -->
						     				<s:if test="%{#obj.yhStatus==95}">
						     					<a href="javascript:void(0);" onclick="doBack('${obj.id }');" title="查看打回理由">打回理由</a>
						     				</s:if>
						     				<s:else>
							     				<s:if test="%{#obj.yhIsXh==0}">
								     				<s:if test="%{#obj.yhIsGp==1}">
								     					<s:if test="%{#obj.yhIsZg==0}">
								     						<a href="javascript:void(0);" onclick="doZg('${obj.id }');" title="填写整改结果">整改</a>
								     					</s:if>
								     					<s:else>
								     						<a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a>
								     						<s:if test="%{#obj.yhSqXh!=1}">
									     						<a href="javascript:void(0);" onclick="doSqXh('${obj.id }');" title="隐患整改完成后，摘牌销号">申请销号</a>
								     						</s:if>
								     					</s:else>
								     				</s:if>
							     				</s:if>
							     				<s:else><a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a></s:else>
						     				</s:else>
						     			</s:if>
						     		</s:if>
						     		
						     		<s:if test="%{#userGrade==3 || #userGrade==5}"><!-- 市行业上报的 -->
						     			<s:if test="%{#obj.yhCome==3 && #obj.yhStatus==1}">
							     			<a href="javascript:void(0);" onclick="doAudit('${obj.id }');" title="填写重大隐患审核结果">审核</a>
						     			</s:if>
						     			<s:if test="%{#obj.yhStatus==95}">
						     					<a href="javascript:void(0);" onclick="doBack('${obj.id }');" title="查看打回理由">打回理由</a>
						     				</s:if>
						     			<s:if test="%{#obj.yhAudit==3 && #obj.yhCome==4}"><!-- 市安委会确认 -->
						     				<s:if test="%{#obj.yhIsXh==0}">
							     				<s:if test="%{#obj.yhIsGp==1}">
							     					<s:if test="%{#obj.yhIsZg==0}">
							     						<a href="javascript:void(0);" onclick="doZg('${obj.id }');" title="填写整改结果">整改</a>
							     					</s:if>
							     					<s:else>
							     						<a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a>
							     						<s:if test="%{#obj.yhSqXh!=1}">
								     						<a href="javascript:void(0);" onclick="doSqXh('${obj.id }');" title="隐患整改完成后，摘牌销号">申请销号</a>
							     						</s:if>
							     					</s:else>
							     				</s:if>
						     				</s:if>
						     				<s:else><a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a></s:else>
						     			</s:if>
						     		</s:if>
						     		<s:if test="%{#userGrade==8}"><!-- 县(市、区)、开发区安委会 -->
						     			<s:if test="%{#obj.yhCome==2 && #obj.yhStatus==1}">
							     			<a href="javascript:void(0);" onclick="doAudit('${obj.id }');" title="填写重大隐患审核结果">审核</a>
						     			</s:if>
						     			<s:if test="%{#obj.yhAudit==2 || #obj.yhAudit==96}">
						     				<s:if test="%{#obj.yhStatus==95}">
						     					<a href="javascript:void(0);" onclick="doBack('${obj.id }');" title="查看打回理由">打回理由</a>
						     				</s:if>
						     				<s:else>
							     				<s:if test="%{#obj.yhIsGp==0}"><a href="javascript:void(0);" onclick="doGp('${obj.id }');" title="填写挂牌督办信息">挂牌</a></s:if>
							     				<s:if test="%{#obj.yhSqXh==1 && #obj.yhIsXh==0}">
								     				<a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a>
									     			<a href="javascript:void(0);" onclick="doXh('${obj.id }');" title="隐患整改完成后，摘牌销号">销号</a>
							     				</s:if>
						     				</s:else>
						     			</s:if>
						     			<!--  
						     			<s:if test="%{#obj.yhAudit==3 && #obj.yhSqXh==1 && #obj.yhIsXh==1}">
						     				<a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a>
						     			</s:if>
						     			-->
					     				<s:if test="%{#obj.yhIsXh==1}"><a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a></s:if>
						     		</s:if>
						     		<s:if test="%{#userGrade==2}"><!-- 市安委会 -->
						     			<s:if test="%{#obj.yhStatus==2}">
							     			<a href="javascript:void(0);" onclick="doAudit('${obj.id }');" title="填写重大隐患审核结果">审核</a>
						     			</s:if>
						     			<s:if test="%{#obj.yhAudit==3}">
						     				<s:if test="%{#obj.yhStatus==95}">
						     					<a href="javascript:void(0);" onclick="doBack('${obj.id }');" title="查看打回理由">打回理由</a>
						     				</s:if>
						     				<s:else>
							     				<s:if test="%{#obj.yhIsGp==0}"><a href="javascript:void(0);" onclick="doGp('${obj.id }');" title="填写挂牌督办信息">挂牌</a></s:if>
							     				<s:if test="%{#obj.yhSqXh==1 && #obj.yhIsXh==0}">
								     				<a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a>
									     			<a href="javascript:void(0);" onclick="doXh('${obj.id }');" title="隐患整改完成后，摘牌销号">销号</a>
							     				</s:if>
						     				</s:else>
						     			</s:if>
					     				<s:if test="%{#obj.yhIsXh==1}"><a href="javascript:void(0);" onclick="doShow('${obj.id }');" title="查看整改信息">整改信息</a></s:if>
						     		</s:if>
					     		</td>
					    	</tr>
			   			</s:iterator>
			    	</s:if>
			    	<s:else>
				    	<tr>
				     		<td align="center" colspan="10">暂无重大隐患数据</td>
				    	</tr>
			    	</s:else>
			   	</tbody>
		  	</table>
		  	<s:if test="%{#userGrade!=0 && #userGrade!=1 && #userGrade!=2 && #userGrade!=8}">
			  	<div class="btn_page">
			  		<input type="button" class="link_input" value="录入重大隐患" onclick="window.location.href='<%=basePath %>/zczb/big_yhAdd.action?${urls }&num=${page.num }&size=${page.size }'"/>
			  	</div>
		  	</s:if>
		  	<div class="page">
				<jsp:include flush="true" page="../share/fenye.jsp">
				    <jsp:param name="url4page" value="/zczb/big_yhList.action?${urls }" />
			    </jsp:include>	
		    </div>
	 	</div>
	</div>
	<form action="<%=basePath%>/zczb/big_yhList.action?search=1" name="form1" method="post">
		<input type="hidden" name="yhId" value="">
		<input type="hidden" name="urls" value="${urls }">
		<input type="hidden" name="num" value="${page.num }">
		<input type="hidden" name="size" value="${page.size }">
	</form>
  </body>
  <s:if test="%{tip!=null}">
    	<script>
    		msgDialog('${tip}','succ.png');
    	</script>
    </s:if>
</html>
